/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Manolis
 */
@Embeddable
public class PurchaseAttemptsPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ATTEMPT_NO")
    private int attemptNo;
    @Basic(optional = false)
    @Column(name = "PURCHASE_ID")
    private int purchaseId;

    public PurchaseAttemptsPK() {
    }

    public PurchaseAttemptsPK(int attemptNo, int purchaseId) {
        this.attemptNo = attemptNo;
        this.purchaseId = purchaseId;
    }

    public int getAttemptNo() {
        return attemptNo;
    }

    public void setAttemptNo(int attemptNo) {
        this.attemptNo = attemptNo;
    }

    public int getPurchaseId() {
        return purchaseId;
    }

    public void setPurchaseId(int purchaseId) {
        this.purchaseId = purchaseId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) attemptNo;
        hash += (int) purchaseId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PurchaseAttemptsPK)) {
            return false;
        }
        PurchaseAttemptsPK other = (PurchaseAttemptsPK) object;
        if (this.attemptNo != other.attemptNo) {
            return false;
        }
        if (this.purchaseId != other.purchaseId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Model.PurchaseAttemptsPK[ attemptNo=" + attemptNo + ", purchaseId=" + purchaseId + " ]";
    }
    
}
